import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
	routes: [
		//经营数据-首页
		{
			path: '/operatingData',
			name: 'operatingData',
			component: function(resolve) {
				require(['@/page/statistics/operatingData'], resolve)
			}
		},
		//测试
		{
			path: '/instance',
			name: 'instance',
			component: function(resolve) {
				require(['@/page/demo/instance'], resolve)
			}
		},
		//客流分析
		{
			path: '/passengerFlow/:id',
			name: 'passengerFlow',
			component: function(resolve) {
				require(['@/page/statistics/passengerFlow'], resolve)
			}
		},
		//营业统计
		{
			path: '/business/:id',
			name: 'business',
			component: function(resolve) {
				require(['@/page/statistics/business'], resolve)
			}
		},
		//顾客分析
		{
			path: '/customerAnalysis/:id',
			name: 'customerAnalysis',
			component: function(resolve) {
				require(['@/page/statistics/customerAnalysis'], resolve)
			}
		},
		//商品
		{
			path: '/goods/:id',
			name: 'goods',
			component: function(resolve) {
				require(['@/page/statistics/goods'], resolve)
			}
		},
		//商家体验
		{
			path: '/experience/:id',
			name: 'experience',
			component: function(resolve) {
				require(['@/page/statistics/experience'], resolve)
			}
		},
		//今日实时数据
		{
			path: '/todayData',
			name: 'todayData',
			component: function(resolve) {
				require(['@/page/statistics/todayData'], resolve)
			}
		},
		//环比分析
		{
			path: '/ringRatio/:id',
			name: 'ringRatio',
			component: function(resolve) {
				require(['@/page/statistics/ringRatio'], resolve)
			}
		},
		//时餐
		{
			path: '/timeMeal/:id',
			name: 'timeMeal',
			component: function(resolve) {
				require(['@/page/statistics/timeMeal'], resolve)
			}
		},
		//商圈同行对比
		{
			path: '/peerCompare/:id',
			name: 'peerCompare',
			component: function(resolve) {
				require(['@/page/statistics/peerCompare'], resolve)
			}
		},
		//无效订单
		{
			path: '/invalidOrder/:id',
			name: 'invalidOrder',
			component: function(resolve) {
				require(['@/page/statistics/invalidOrder'], resolve)
			}
		},
		//活动列表
		{
			path: '/actList/:id',
			name: 'actList',
			component: function(resolve) {
				require(['@/page/activity/actList'], resolve)
			}
		},
		//营销月报
		{
			path: '/monthlyReport',
			name: 'monthlyReport',
			component: function(resolve) {
				require(['@/page/activity/monthlyReport'], resolve)
			}
		},
		//指标说明
		{
			path: '/indicatorDesc',
			name: 'indicatorDesc',
			component: function(resolve) {
				require(['@/page/activity/indicatorDesc'], resolve)
			}
		},
		//编辑顾客分组
		{
			path: '/editGroup',
			name: 'editGroup',
			component: function(resolve) {
				require(['@/page/activity/editGroup'], resolve)
			}
		},
		//创建活动
		{
			path: '/createAct',
			name: 'createAct',
			component: function(resolve) {
				require(['@/page/activity/createAct'], resolve)
			}
		},
		//创建店外活动
		{
			path: '/createOuterAct',
			name: 'createOuterAct',
			component: function(resolve) {
				require(['@/page/activity/createOuterAct'], resolve)
			}
		},
		//满减
		{
			path: '/fullReduce',
			name: 'fullReduce',
			component: function(resolve) {
				require(['@/page/activity/fullReduce'], resolve)
			}
		},
		//减配送费
		{
			path: '/distribution',
			name: 'distribution',
			component: function(resolve) {
				require(['@/page/activity/distribution'], resolve)
			}
		},
		//商家自营销协议
		{
			path: '/protocol',
			name: 'protocol',
			component: function(resolve) {
				require(['@/page/activity/protocol'], resolve)
			}
		},
		//折扣商品活动
		{
			path: '/discountAct',
			name: 'discountAct',
			component: function(resolve) {
				require(['@/page/activity/discountAct'], resolve)
			}
		},
		//下单返券
		{
			path: '/returnTicket',
			name: 'returnTicket',
			component: function(resolve) {
				require(['@/page/activity/returnTicket'], resolve)
			}
		},
		//新客立减
		{
			path: '/newGuestAct',
			name: 'newGuestAct',
			component: function(resolve) {
				require(['@/page/activity/newGuestAct'], resolve)
			}
		},
		//折扣商品详情
		{
			path: '/discountGoods/:id',
			name: 'discountGoods',
			component: function(resolve) {
				require(['@/page/activity/discountGoods'], resolve)
			}
		},		
		//开通功能
		{
			path: '/openFunction',
			name: 'openFunction',
			component: function(resolve) {
				require(['@/page/functions/openFunction/openFunction'], resolve)
			}
		},
		//支付
		{
			path: '/payment',
			name: 'payment',
			component: function(resolve) {
				require(['@/page/pays/payment'], resolve)
			}
		},
		//团购入口
		{
			path: '/entrance',
			name: 'entrance',
			component: function(resolve) {
				require(['@/page/groups/entrance'], resolve)
			},
			meta: {
				show: true,
			}
		},
		//团购列表
		{
			path: '/groupList',
			name: 'groupList',
			component: function(resolve) {
				require(['@/page/groups/groupList'], resolve)
			},
			meta: {
				show: true,
			}
		},		
		//客服中心
		{
			path: '/customerService',
			name: 'customerService',
			component: function(resolve) {
				require(['@/page/groups/customerService'], resolve)
			},			
		},			
		//发布团购
		{
			path: '/groupRelease',
			name: 'groupRelease',
			component: function(resolve) {
				require(['@/page/groups/groupRelease'], resolve)
			},			
		},
		//修改团购
		{
			path: '/groupModify/:id',
			name: 'groupModify',
			component: function(resolve) {
				require(['@/page/groups/groupModify'], resolve)
			},
		},
		//代金券入口
		{
			path: '/ticketEntry',
			name: 'ticketEntry',
			component: function(resolve) {
				require(['@/page/groups/ticketEntry'], resolve)
			}
		},
		//闲时引流券
		{
			path: '/drainingCoupons',
			name: 'drainingCoupons',
			component: function(resolve) {
				require(['@/page/groups/drainingCoupons'], resolve)
			}
		},
        //选择代金券品类
        {
            path: '/ticketType',
            name: 'ticketType',
            component: function(resolve) {
                require(['@/page/groups/ticketType'], resolve)
            }
        },
        //发布代金券
        {
            path: '/ticketRelease',
            name: 'ticketRelease',
            component: function(resolve) {
                require(['@/page/groups/ticketRelease'], resolve)
            }
        },
        //券集市
        {
            path: '/vouchers',
            name: 'vouchers',
            component: function(resolve) {
                require(['@/page/voucherMarket/vouchers'], resolve)
            }
        },
        //转让历史
        {
            path: '/transferHistory',
            name: 'transferHistory',
            component: function(resolve) {
                require(['@/page/voucherMarket/transferHistory'], resolve)
            }
        },
        //优惠券
        {
            path: '/myTickets',
            name: 'myTickets',
            component: function(resolve) {
                require(['@/page/voucherMarket/myTickets'], resolve)
            }
        },
		//确认开通功能
		{
			path: '/openConfirm/:id',
			name: 'openConfirm',
			component: function(resolve) {
				require(['@/page/functions/openConfirm'], resolve)
			}
		},
		//活动管理
		{
			path: '/activityManagement',
			name: 'activityManagement',
			component: function(resolve) {
				require(['@/page/functions/activityManagement'], resolve)
			}
		},
		//发布活动
		{
			path: '/createActivity',
			name: 'createActivity',
			component: function(resolve) {
				require(['@/page/functions/createActivity/createActivity'], resolve)
			}
		},
		//外卖配送
		{
			path: '/foodDispatch',
			name: 'foodDispatch',
			component: function(resolve) {
				require(['@/page/functions/foodDispatch'], resolve)
			}
		},
		//优惠券活动
		{
			path: '/coupon',
			name: 'coupon',
			component: function(resolve) {
				require(['@/page/functions/coupon'], resolve)
			}
		},
		//搭配管理
		{
			path: '/collocationBuy',
			name: 'collocationBuy',
			component: function(resolve) {
				require(['@/page/functions/collocationBuy'], resolve)
			}
		},
		//服装列表
		{
			path: '/clothesList',
			name: 'clothesList',
			component: function(resolve) {
				require(['@/page/functions/clothesList'], resolve)
			}
		},
		//认领设置
		{
			path: '/setting',
			name: 'setting',
			component: function(resolve) {
				require(['@/page/functions/setting'], resolve)
			}
		},
		//店铺列表
		{
			path: '/shoplist',
			name: 'shop',
			component: function(resolve) {
				require(['@/page/functions/shoplist/shoplist'], resolve)
			}
		},
		//审核结果
		{
			path: '/examine',
			name: 'examine',
			component: function(resolve) {
				require(['@/page/functions/examine'], resolve)
			}
		},
		
		//创建新的店铺
		{
			path: '/createStore',
			name: 'createStore',
			component: function(resolve) {
				require(['@/page/functions/createStore'], resolve)
			}
		},
		//宝店认领-列表
		{
			path: '/coinShopList',
			name: 'coinShopList',
			component: function(resolve) {
				require(['@/page/coinShop/coinShopList'], resolve)
			}
		},
		//宝店认领-认领
		{
			path: '/getStore',
			name: 'getStore',
			component: function(resolve) {
				require(['@/page/coinShop/getStore'], resolve)
			}
		},
		//宝店认领-首页
		{
			path: '/home',
			name: 'home',
			component: function(resolve) {
				require(['@/page/coinShop/home'], resolve)
			}
		},
		//宝店信息完善-个人
		{
			path: '/personalInfo',
			name: 'personalInfo',
			component: function(resolve) {
				require(['@/page/coinShop/personalInfo'], resolve)
			}
		},
		//宝店信息完善-企业
		{
			path: '/enterpriseInfo',
			name: 'enterpriseInfo',
			component: function(resolve) {
				require(['@/page/coinShop/enterpriseInfo'], resolve)
			}
		},
		//类型选择
		{
			path: '/type',
			name: 'type',
			component: function(resolve) {
				require(['@/page/coinShop/type'], resolve)
			}
		},
		//代人开店
		{
			path: '/proxyOpen',
			name: 'proxyOpen',
			component: function(resolve) {
				require(['@/page/coinShop/proxyOpen'], resolve)
			}
		},
		
		//自己开店
		{
			path: '/selfOpen',
			name: 'selfOpen',
			component: function(resolve) {
				require(['@/page/coinShop/selfOpen'], resolve)
			}
		},
		//关联
		{
			path:'/relevance',
			name:'relevance',
			component:function(resolve){
				require(['@/page/functions/relevance'],resolve)
			}
		},
		//关联者信息
		{	
			path:'/authenticator',
			name:'authenticator',
			component:function(resolve){
				require(['@/page/functions/authenticator'],resolve)
			}
		},
		//市场列表
		{	
			path:'/marketList',
			name:'marketList',
			component:function(resolve){
				require(['@/page/marketAct/marketList'],resolve)
			}
		},
		//市场活动列表
		{	
			path:'/marketActList',
			name:'marketActList',
			component:function(resolve){
				require(['@/page/marketAct/marketActList'],resolve)
			}
		},
		//市场活动推广详情
		{	
			path:'/marketActDetail/:id',
			name:'marketActDetail',
			component:function(resolve){
				require(['@/page/marketAct/marketActDetail'],resolve)
			}
		},
		//市场活动推广
		{	
			path:'/marketActPromote',
			name:'marketActPromote',
			component:function(resolve){
				require(['@/page/marketAct/marketActPromote'],resolve)
			}
		},
		//市场活动报名
		{	
			path:'/marketActSign',
			name:'marketActSign',
			component:function(resolve){
				require(['@/page/marketAct/marketActSign'],resolve)
			}
		},
		//秒杀列表
		{	
			path:'/seckList',
			name:'seckList',
			component:function(resolve){
				require(['@/page/seckill/seckList'],resolve)
			}
		},
		//报名秒杀
		{	
			path:'/signSeckill',
			name:'signSeckill',
			component:function(resolve){
				require(['@/page/seckill/signSeckill'],resolve)
			}
		},
		//获取服务号
		{	
			path:'/queryServerNum',
			name:'queryServerNum',
			component:function(resolve){
				require(['@/page/functions/queryServerNum'],resolve)
			}
		},
		//自主开店
		{	
			path:'/createByType',
			name:'createByType',
			component:function(resolve){
				require(['@/page/coinShop/createByType'],resolve)
			}
		},
		//获取代开资格，验证开店
		{
			path : '/proxyOpenShop',
			name : 'proxyOpenShop',
			component : function(resolve){
				require(['@/page/coinShop/proxyOpenShop'],resolve)
			}
		},
		//自主开店
		{	
			path:'/goContact',
			name:'goContact',
			component:function(resolve){
				require(['@/page/functions/goContact'],resolve)
			}
		},
		//创建店铺
		{	
			path:'/createShop',
			name:'createShop',
			component:function(resolve){
				require(['@/page/functions/createShop'],resolve)
			}
		},
		//选择分享类型
		{	
			path:'/shareSelect',
			name:'shareSelect',
			component:function(resolve){
				require(['@/page/coinShop/shareSelect'],resolve)
			}
		},
		//分享页
		{
			path:'/shareDetail',
			name:'shareDetail',
			component:function(resolve){
				require(['@/page/coinShop/shareDetail'],resolve)
			}
		},
		//来自朋友的分享
		{
			path:'/sharingFriends',
			name:'sharingFriends',
			component:function(resolve){
				require(['@/page/coinShop/sharingFriends'],resolve)
			}
		},
		//查看我的店铺或ta的店铺
		{
			path:'/hisShops',
			name:'hisShops',
			component:function(resolve){
				require(['@/page/coinShop/hisShops'],resolve)
			}
		},
		//原厂直销列表
		{
			path:'/manufactor',
			name:'manufactor',
			component:function(resolve){
				require(['@/page/coinShop/manufactor'],resolve)
			}
		},
		//原厂直销认领说明
		{
			path:'/factoryClaim',
			name:'factoryClaim',
			component:function(resolve){
				require(['@/page/coinShop/factoryClaim'],resolve)
			}
		},
		//原厂直销认领
		{
			path:'/manufactorDetail',
			name:'manufactorDetail',
			component:function(resolve){
				require(['@/page/coinShop/manufactorDetail'],resolve)
			}
		},
		{
			path:'/marketing',
			name:'market',
			component:function(resolve){
				require(['@/page/coinShop/marketing'],resolve)
			}
		},
		//了解开奖宝店
		{
			path:'/prizeShop',
			name:'prizeShop',
			component:function(resolve){
				require(['@/page/coinShop/prizeShop'],resolve)
			}
		},
		//查看如何获取链接
		{	
			path:'/viewGetLink',
			name:'viewGetLink',
			component:function(resolve){
				require(['@/page/coinShop/viewGetLink'],resolve)
			}
		},
		
		//默认主页
    	{ path: '*', redirect:'/operatingData'}
	],
	scrollBehavior (to, from, savedPosition) {
    	return { x: 0, y: 0 }
  	}
})